package com.jzo2o.market.controller.operation;

import com.jzo2o.common.model.PageResult;
import com.jzo2o.market.model.dto.request.ActivityQueryForPageReqDTO;
import com.jzo2o.market.model.dto.request.ActivitySaveReqDTO;
import com.jzo2o.market.model.dto.response.ActivityInfoResDTO;
import com.jzo2o.market.service.IActivityService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ Tool：IntelliJ IDEA
 * @ Author：徐茂茂
 * @ Date：2025-10-21-0:07
 * @ Version：1.0
 * @ Description：
 */

@RestController("operationActivityController")
@RequestMapping("/operation/activity")
public class operationActivityController {

    @Resource
    private IActivityService activityService;

    @PostMapping("/save")
    public void save(@RequestBody ActivitySaveReqDTO activitySaveReqDTO){
        activityService.addActivity(activitySaveReqDTO);
    }

    @GetMapping("/page")
    public PageResult<ActivityInfoResDTO> page(ActivityQueryForPageReqDTO activityQueryForPageReqDTO){
        return activityService.pageActivity(activityQueryForPageReqDTO);
    }

    @GetMapping("/{id}")
    public ActivityInfoResDTO getDetail(@PathVariable("id")Long id){
        return activityService.getDetail(id);
    }



}
